import navConfig from '@/data/nav.config'

const navs = navConfig.reduce((acc, nav) => {
  const temp = nav.list.map(item => ({
    path: `/Home/${item.name}`,
    name: `${item.name}`,
    component: () => import(`../../views/Navs/content/${item.name}`),
    meta: {
      name: `${item.name}`,
      desc: `${item.desc}`,
    },
  }))
  acc.push(...temp)
  return acc
}, [])

export default [
  {
    path: '/Home/Navs',
    name: 'Navs',
    component: () => import(`../../views/Navs`),
    children: navs,
  },
]
